# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=certi
pkgver=6.6cfa656
pkgrel=4
pkgdesc='Active Directory Certificate Services (ADCS) abuser. impacket copy of Certify.'
arch=('any')
groups=('blackarch' 'blackarch-windows')
url='https://github.com/zer1t0/certi'
license=('AGPL-3.0-only')
depends=('python' 'python-cryptography' 'impacket')
makedepends=('git' 'python-setuptools')
source=("git+$url.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  ( set -o pipefail
    git describe --long --tags --abbrev=7 2>/dev/null |
      sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
    printf "%s.%s" "$(git rev-list --count HEAD)" \
      "$(git rev-parse --short=7 HEAD)"
  )
}

build() {
  cd "$pkgname"

  python setup.py build
}

package() {
  cd "$pkgname"

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

